package com.robot.backend.service.impl.pk;

import com.robot.backend.consumer.WebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.robot.backend.service.pk.pkReceiveDireService;
@Service
public class pkReceiveDireServiceImpl implements pkReceiveDireService{
    @Override
    public String receiveDirection(int d,int uid) {
        if(WebSocketServer.users.get(uid) != null){//bot执行
            if(uid== WebSocketServer.users.get(uid).game.getPlayer1().getId())
                WebSocketServer.users.get(uid).game.setStepA(d);
            else WebSocketServer.users.get(uid).game.setStepB(d);
        }
        return "success";
    }
}
